BSTR, lpstr, lpwstr, cstring, variant, colevariant, _ variant_t, ccombstr, _ bstr_t visual c ++. net involves multiple programming methods such as ATL/ATL server, MFC, and hosting C ++. It is not only powerful but also widely used. In programming,
Reference articlesHttp://blog.163.com/[email protected]/blog/static/16219623020107634935586/http://blog.csdn.net/dreamcs/article/details/7186633Http://blog.sina.com.cn/s/blog_6c3d32da0100ua13.htmlCOleVariant is the data type that the database is
first, the basic knowledge of COM components introduction:
1, what is COM
COM is a Microsoft set up a component of the specification, the purpose is to achieve the reuse of components, whether you are in C, DELPHI, VB what language to write, as
Com features language-neutral and hardware-neutral. Obviously, it requires a text data type that is language-neutral and hardware-neutral.Olechar and BSTR are used for this purpose.Olechar: The character type used by com on the target operating
In Ole, ActiveX, and COM, the variant data type provides a very effective mechanism because it includes both the data itself and the data type, therefore, it can realize various automatic data transmission. Let's take a look at a simplified version
In the com method, array data can be transmitted using the variant type and processed using safearray in VC ++. The following example shows the input and output arrays.
1. Input an array to comStdmethodimp ctestcom1: vb2vc (variant buffer){Long dim
Variant is one of the important parameter variables for communication between COM components. It can accommodate a variety of different types, such as short, long, and double, including various pointers and arrays. Mutual calling between components
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
//
The integer type is exactly four bytes, And the integer int type is one byte, but the memory in Windows is 4 bytes allocated,
//
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.